package com.mall.sun.service.impl;

import com.mall.sun.model.dto.GoodSupplierDTO;
import com.mall.sun.model.po.Supplier;
import com.mall.sun.repository.mapper.GoodsMapper;
import com.mall.sun.repository.mapper.SupplierMapper;
import com.mall.sun.service.SupplierService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Tansty
 * @since 2021-11-30
 */
@Service
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements SupplierService {
    @Autowired
    SupplierMapper supplierMapper;
    @Autowired
    GoodsMapper goodsMapper;
    @Override
    public int updateSupplier(GoodSupplierDTO goodSupplierDTO) {
        goodsMapper.updateSupplier(goodSupplierDTO);
        return supplierMapper.updateSupplier(goodSupplierDTO);
    }

    @Override
    public Long countSupplier() {
        return supplierMapper.countSupplier();
    }
}
